package com.you.atlas.web.place.module.screen;

import com.alibaba.citrus.service.form.Group;
import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.dataresolver.FormGroup;

public class PhotoAdd {

    public void execute(@FormGroup("addPhoto") Group group, Context context,Navigator navigator) {
        if(context.get("imgUrl")==null){
            navigator.redirectTo("placeModule").withTarget("error.vm");
        }
        group.getField("imgUrl").setValue(context.get("imgUrl"));
        group.getField("thumbImgUrl").setValue(context.get("thumbImgUrl"));
    }
}
